def androidlrudkeys(block):
    "map 4628 to lrud, as there are no lrud keys on Android phones"
    block = _keyfilter(block)
    return block


def _check(char, block):
	if char in block[0]["k"]: 
		return True

_cursor_buttons = {
    '4' : 'l', # left
    '6' : 'r', # right
    '2' : 'u', # up
    '8' : 'd', # down
}

def _keyfilter(block):
    "click detection"
    for char in _cursor_buttons:
        if _check(char, block):
            lis = list(block[0]["k"])
            lis[lis.index(char)] = _cursor_buttons[char]
            block[0]["k"] = "".join(lis)
    return block
